﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GearUp.Crawler.Entities;
using Xunit;

namespace GearUp.Crawler.Tests
{
    public class WhenALorebookDocumentIsPersisted
    {
        private string theUrl = "http://lorebook.lotro.com/wiki/Armour:Breastplate_of_the_Lady%27s_Courage";

        [Fact]
        public void ShouldBeSavedCorrectly()
        {
            var item = new LorebookItem(theUrl)
                           {
                               Name = "Breastplate of the Lady's Courage",
                               ItemBinding = ItemBinding.BindOnAcquire,
                               UniqueItem = true,
                               Effects = new ItemEffects()
                               {
                                   PowerBonus = 170,
                                   MightBonus = 42,
                                   AgilityBonus = 21,
                                   VitalityBonus = 42,
                                   Radiance = 20
                               },
                               Durability = 95,
                               Sturdiness = "Tough",
                               MinimumLevel = 60,
                               Description = "This armour is granted...",
                               SetName = "Armour of the Lady's Courage"
                           };
            item.Classes.Add("Captain");
            var repository = new LoreBookItemRepository();
            repository.Save(theUrl, item);

        }
    }
}
